Check Console for Output
For Explanation Click Here1.Traffic Light System Simulate a traffic light system: If the light is red, log "Stop." If the light is yellow, log "Get ready to move." If the light is green, log "Go." If the input doesn't match any color, log "Invalid input." var light="blue"; if(light=="red") { console.log("Stop."); } else if(light=="yellow") { console.log ("Get ready to move."); } else if(light=="green") { console.log("Go."); } else { console.log ("Invalid input"); } A:Output: Invalid input 2.Weather Description (Temperature Descriptions) Write a program that describes the temperature: If the temperature is exactly 0, log "It's freezing cold." If the temperature is exactly 15, log "It's a cool day." If the temperature is exactly 25, log "It's a pleasant day." If the temperature doesn't match any of these, log "Unknown weather." var temperature=25; if(temperature==0) { console.log ("It's freezing cold."); } else if(temperature==15) { console.log ("It's a cool day."); } else if(temperature==25) { console.log ("It's a pleasant day."); } else { console.log ("Unknown weather."); }; A:Output: It's a pleasant day. 3.Day of the Week Create a program that takes input of a number representing the day of the week (1-7): If the number is 1, log "Today is Monday." If the number is 2, log "Today is Tuesday." If the number is 3, log "Today is Wednesday." If the number is 4, log "Today is Thursday." If the number is 5, log "Today is Friday." If the number is 6, log "Today is Saturday." If the number is 7, log "Today is Sunday." If the input is not between 1 and 7, log "Invalid day number." var day_week=6; if (day_week ==1) { console.log ("Today is Monday."); } else if (day_week ==2) { console.log ("Today is Tuesday."); } else if (day_week ==3) { console.log ("Today is Wednesday."); } else if (day_week ==4) { console.log ("Today is Thrusday."); } else if (day_week ==5) { console.log ("Today is Friday."); } else if (day_week ==6) { console.log ("Today is Saturday."); } else if (day_week ==7) { console.log ("Today is Sunday."); } else { console.log ("Invalid day number.") } A:Output: Today is Saturday.